<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>鑫乐居——首页</title>
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<script src="js/jquery.js"></script>
  <script src="js/bootstrap.min.js"></script>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="stylesheet" href="css/indexcss.css">
 <!-- <script type="text/javascript" src="js/indexform.js"></script>
	<!--[if it IE 9]>
	<scritp src="html5shiv.js"></script>
	<script src="respond.min.js"></script>
	<![end if]-->
	<script type="text/javascript">
		window.onload = function () {
			var ckf = document.getElementById('ckf');
			var okf = document.getElementById('okf');
			var kf = document.getElementById('kf');
			var sh = document.getElementById('sh');
			var cl = document.getElementById('cl');
			var mix = document.getElementById('mix');
			var ques = document.getElementById('ques');
			var lyb = document.getElementById('lyb');
			mix.onclick = function () {
				ques.style.display = "block";
				lyb.style.display = "none";
			}
			ques.onclick = function () {
				lyb.style.display = "block";
				ques.style.display = "none";
			}
			ckf.onclick = function () {
				okf.style.display = "block";
				kf.style.display = "none";
			}
			okf.onclick = function () {
				kf.style.display = "block";
				okf.style.display = "none";
			}
			cl.onclick = function () {
				zx.style.display = "none";
				if (zx.style.display = "none") {
					setInterval("zx.style.display = 'block'",5000);
				}
			}
			sh.onclick = function () {
				zx.style.display = "none";
				if (zx.style.display = "none") {
					setInterval("zx.style.display = 'block'",5000);
				}
			}
		}
	</script>
</head>
<body>
	<form action="form.php" method="post" id="biaodan">
		<div id="cont">
		<!-- 头部，包括logo，导航 -->
			<div id="head">
				<div class="logo"></div>
				<div class="tel">
					<div class="phone"></div>
					<span>400-160-140</span>
				</div>
				<div class="login">
					<span><a href="login.html">登录</a></span>
					<span><a href="zhuce.php">注册</a></span>
				</div>
				<div class="dh">
					<ul>
						<?php
       				include "shuju.php";
                    $db = new DB();
                    $sql = "select * from navigation where pid is null";
                    $res = $db->get($sql);
                    for ($i=1; $i <=count($res) ; $i++) {     
                        $fir = $res[$i-1][1];
                        $id = $res[$i-1][0];
                        $href = $res[$i-1][3];
                        echo "<li class='li1'><a href='$href'>$fir</a><ul>";
                        $sql = "select * from navigation where pid = '$id'";
                        $ss = $db->get($sql);
                        for ($j=1; $j <=count($ss) ; $j++) { 
                          $sec = $ss[$j-1][1];
                          $sechr = $ss[$j-1][3];
                          echo "<li><a href='$sechr'>$sec</a></li>";
                        }
                        echo"</ul></li>";
                    }
                  ?>
					</ul>
				</div>
			</div>
		<!-- 幻灯片 -->
			<div id="power">
				<div id="myCarousel" class="carousel slide">
					<ol class="carousel-indicators">
					<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
					<li data-target="#myCarousel" data-slide-to="1"></li>
					</ol>
				<div class="carousel-inner">
				<?php 
					$db = new DB();
					$sql = "select * from power";
					$res = $db->get($sql);
					for ($i=1; $i <= 1 ; $i++) { 
						$src = $res[$i-1][1];
						if ($i=1) {
							echo "<div class='item active'><img src='$src' alt=''></div>";
						}
					}
				 ?>
				 <?php 
					$db = new DB();
					$sql = "select * from power";
					$res = $db->get($sql);
					for ($i=2; $i <= count($res) ; $i++) { 
						$src = $res[$i-1][1];
							echo "<div class='item'><img src='$src' alt=''></div>";
					}
				 ?>
				</div>
				<a href="#myCarousel" class="carousel-control left" data-slide="prev" style="">&lsaquo;</a>
				<a href="#myCarousel" class="carousel-control right" data-slide="next" id="next">&rsaquo;</a>
				</div>
			</div>
		<!-- 中间三个链接 -->
			<div id="news">
				<div class="news1"><a href="">
					<div class="ne1">资源下载</div>
					<div class="pic1"></div>
					<div class="ne2"><span>鑫乐居O2O项目APP下载</span></div>
				</a></div>
				<div class="news2"><a href="">
					<div class="ne1">精彩活动</div>
					<div class="pic1"></div>
					<div class="ne2"><span>ERP促销活动</span></div>
				</a></div>
				<div class="news3"><a href="">
					<div class="ne1">相关视频</div>
					<div class="pic1"></div>
					<div class="ne2"><span>ERP视频下载</span></div>
				</a></div>
			</div>
			<div id="foot">
				<span>Copyright  2010-2015 All Rights Reserved. 京ICP备15041059号-1 京公网安备11010502027337 北京瑞卓喜创科技发展有限公司版权所有</span>
			</div>
			<div id="bot"></div>
			<!-- 客服框 -->
			<div id="kf">
				<div class="kf1"></div>
				<div class="kf2">
					<span>鑫乐居顾问</span>
					<div class="kf5">
		            <div class="kk1"></div>
		            <span>鑫乐居</span>
		          </div>
		          <div class="kf6">
		            <div class="kk1"></div>
		            <span>客服5</span>
		          </div>
		          <div class="kf7">
		            <div class="kk1"></div>
		            <span>客服9</span>
		          </div>
				</div>
				<div class="kf3" id="ckf"></div>
			</div>
			<div class="kf4" id="okf"></div>
			<!-- 定时咨询弹出框 -->
			<div id="zx">
				<div class="close" id="cl"></div>
				<p>欢迎您，有什么可以帮助您的么？公司顾问在线为您解答。</p>
				<div class="btn btn-default" id="sh">稍后再说</div>
				<div class="btn btn-info" id="now">现在咨询</div>
			</div>
			<div id="lyb">
				<div class="mix" id="mix"></div>
				<div class="form">
					<textarea name="texta" id="texta" cols="30" rows="10" class="are" placeholder="请再次输入留言内容，我们会尽快与您联系。"></textarea>
					<div class="text1" >
						<div class="name">姓名</div>
						<input type="text" class="name1" placeholder="最多100个字符" name="username" id="username">
					</div>
					<div class="text2">
						<div class="phone">电话</div>
						<input type="text" placeholder="请输入您的手机号码" class="phone1" name="phone" id="phone">
					</div>
					<div class="text3">
						<div class="address">地址</div>
						<input type="text" placeholder="最多100个字符" class="address1" name="address" id="address">
					</div>
					<div class="text4">
						<div class="email">邮箱</div>
						<input type="text" placeholder="请输入合法邮箱名" class="email1" name="email" id="email">
					</div>
					<input type="submit" name="submit" class="sub" value="提交" id="sub">
				</div>
			</div>
			<div id="ques"></div>
		</div>
	</form>
	<script type="text/javascript">

		var texta = document.getElementById('texta');
		var username = document.getElementById('username');
		var phone = document.getElementById('phone');
		var address = document.getElementById('address');
		var email = document.getElementById('email');
		var sub = document.getElementById('sub');
		var biaodan = document.getElementById('biaodan');
//只验证表单字段长度
		sub.onclick = function () {
			if (texta.value == "") {
				alert("留言内容不能为空！");
				biaodan.action = "";
			}else{
				biaodan.action = "form.php";
			}
		}
</script>
</body>
</html>
